package com.jk.bgmainconsumer.service;

import com.jk.bgmainconsumer.entity.IndentEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Service
public class EchartsService {
    @Autowired
    private MongoTemplate MongoTemplate;
/**
 * @description:  图标查询
 * @param: []
 * @return: java.util.List<com.jk.bgmainconsumer.entity.IndentEntity>
 * @author 刘杨彬
 * @date: 2021/9/14 15:20
 */

    public List<IndentEntity> findEcharts() {
        Query query = new Query();
        List<IndentEntity> indentEntities = MongoTemplate.find(query, IndentEntity.class);
        return indentEntities;
    }
    public List<IndentEntity> findEcharts2() {
        Query query = new Query();
        query.addCriteria(Criteria.where("id").is("1"));
        List<IndentEntity> indentEntities = MongoTemplate.find(query, IndentEntity.class);
        return indentEntities;
    }

}
